<template>
  <div>
    ComA
    <ComB v-bind="$attrs"></ComB>
  </div>
</template>

<script>
import ComB from "./ComB";
import { bus } from "../bus";
export default {
  components: {
    ComB,
  },
  provide() {
    return {
      foo: "foo",
      bar: "bar",
      comA: this,
    };
  },
  inheritAttrs: false,
  mounted() {
    // 如果传过来的值没有在 props 里面定义 ，那么就可以在 attrs 里面获取到
    // console.log(this.$attrs);
    console.log(this.$listeners);

    bus.$on("waitComC", (v) => {
        console.log(v)
      console.log("comA - wait comC");
    });
  },
};
</script>

<style></style>
